package com.hpq.common.config;

import cn.hutool.json.JSONUtil;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

/**
 * @author hpq
 * @date 2020/10/16 16:05
 * @description 微信公众号配置
 */
@Data
@ConfigurationProperties(prefix = "wx.mp")
public class WxMpProperties {
    //是否使用redis存储access_token
    private boolean useRedis;
//多个微信公众号配置
    List<MpConfig> configs;
    @Data
   public  static class MpConfig{
        //微信公众号appid
        private String appId;
        //
        private String appSecret;
        //微信公众号token
        private String token;
        //微信公众号消息加解密密钥
        private String aesKey;
    }
    @Override
    public String toString() {
        return JSONUtil.toJsonStr(this);
    }
}
